package com.ims.core.doc.service;

import java.util.List;
import com.ims.core.doc.domain.TScSettlebill;
import com.ims.core.doc.domain.TScSettlebillRequest;

/**
 * 结算单Service接口
 *
 * @author IMS
 * @date 2024-05-30
 */
public interface ITScSettlebillService
{
    /**
     * 查询结算单
     *
     * @param id 结算单主键
     * @return 结算单
     */
    public TScSettlebill selectTScSettlebillById(Long id);

    /**
     * 查询结算单
     *
     * @param settleId 结算单主键
     * @return 结算单
     */
    public TScSettlebill selectTScSettlebillBySettleId(String settleId);

    /**
     * 查询结算单
     * 返回的明细为可开票明细
     * @param id 结算单主键
     * @return 结算单
     */
    public TScSettlebill selectTScSettlebillByIdForInvoice(Long id);

    /**
     * 查询结算单-合并开票用
     * 返回的明细为可开票明细
     * @param ids 结算单主键
     * @return 结算单
     */
    public TScSettlebill selectTScSettlebillByIdForMergeInvoice(Long[] ids);

    /**
     * 查询结算单列表
     *
     * @param tScSettlebill 结算单
     * @return 结算单集合
     */
    public List<TScSettlebill> selectTScSettlebillList(TScSettlebill tScSettlebill);

    /**
     * 新增结算单
     *
     * @param tScSettlebill 结算单
     * @return 结果
     */
    public int insertTScSettlebill(TScSettlebill tScSettlebill);

    /**
     * 修改结算单
     *
     * @param tScSettlebill 结算单
     * @return 结果
     */
    public int updateTScSettlebill(TScSettlebill tScSettlebill);

    /**
     * 修改结算单(仅头部)
     *
     * @param tScSettlebill 结算单
     * @return 结果
     */
    public int updateTScSettlebillOnly(TScSettlebill tScSettlebill);

    /**
     * 修改结算单（ERP同步使用）
     *
     * @param tScSettlebill 结算单
     * @return 结果
     */
    public int updateTScSettlebillForErp(TScSettlebill tScSettlebill);


    /**
     * 批量删除结算单
     *
     * @param ids 需要删除的结算单主键集合
     * @return 结果
     */
    public int deleteTScSettlebillByIds(Long[] ids);

    /**
     * 结算单生成待开
     *
     * @param ids 需要生成待开的结算单主键集合
     * @return 结果
     */
    public void createInvoiceBySettlebillIds(Long[] ids);

    /**
     * 删除结算单信息
     *
     * @param id 结算单主键
     * @return 结果
     */
    public int deleteTScSettlebillById(Long id);


    /**
     * 保存拆分后的结算单为待开票
     * @param tScSettlebill 结算单
     * @return 结果
     */
    public void saveAsSalInvoice(TScSettlebillRequest tScSettlebill);


    /**
     * 保存合并后的结算单为待开票
     * @param tScSettlebill 结算单
     * @return 结果
     */
    public void saveAsMergeSalInvoice(TScSettlebillRequest tScSettlebill);


    /**
     *
     * @param tScSettlebillList
     */
    public void syncSettlebillByErp(List<TScSettlebill> tScSettlebillList);

    /**
     *
     */
    public void syncSettlebillWirteBackByErp();
}
